package net.risesoft.y9.pubsub.event;

import java.io.Serializable;

import org.springframework.context.ApplicationEvent;

/**
 * 任务事件
 * @author dingzhaojun
 * @author qinman
 * @author mengjuhua
 * @date 2022/2/10
 */
public class Y9EventTask extends ApplicationEvent {
    private static final long serialVersionUID = 5693234105948292780L;

    public static final String TASK = "TASK";
    public static final String TASKEVENTNAME_CREATE = "create";
    public static final String TASKEVENTNAME_ASSIGNMENT = "assignment";
    public static final String TASKEVENTNAME_COMPLETE = "complete";
    public static final String TASKEVENTNAME_DELETE = "delete";

    private Object taskObj;
    private String eventType;
    private String eventTarget;
    private String tenantId;
    private String personId;

    public Y9EventTask() {
        super("event source");
    }

    public Y9EventTask(Object source, Serializable taskObj, String eventType, String eventTarget, String tenantId, String personId) {
        super("event source");
        this.taskObj = taskObj;
        this.eventType = eventType;
        this.eventTarget = eventTarget;
        this.tenantId = tenantId;
        this.personId = personId;
    }

    public String getEventTarget() {
        return eventTarget;
    }

    public String getEventType() {
        return eventType;
    }

    public String getPersonId() {
        return personId;
    }

    public Object getTaskObj() {
        return taskObj;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setEventTarget(String eventTarget) {
        this.eventTarget = eventTarget;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public void setPersonId(String personId) {
        this.personId = personId;
    }

    public void setTaskObj(Object taskObj) {
        this.taskObj = taskObj;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    @Override
    public String toString() {
        return "Y9EventTask [taskObj=" + taskObj + ", eventType=" + eventType + ", eventTarget=" + eventTarget + ", tenantId=" + tenantId + ", personId=" + personId + "]";
    }
}